package personal.dao.accounting;

import java.util.List;

import personal.dao.support.TransactionSearchCriteria;
import personal.domain.accounting.ExpenseTransaction;
import personal.domain.accounting.IncomeTransaction;
import personal.domain.accounting.TransferTransaction;


public interface TransactionDAO {
	/**
	 * Saves (insert or update) an expense transaction.
	 * @param transaction - Expense Transaction to be saved.
	 * @return - ExpenseTransaction entity with generated transaction id (for insert).
	 */
	public ExpenseTransaction saveExpenseTransaction(ExpenseTransaction transaction);
	/**
	 * Saves (insert or update) an income transaction.
	 * @param transaction - Income Transaction to be saved.
	 * @return - IncomeTransaction entity with generated transaction id (for insert).
	 */
	public IncomeTransaction saveIncomeTransaction(IncomeTransaction transaction);
	/**
	 * Saves (insert or update) a transfer transaction.
	 * @param transaction - Transfer Transaction to be saved.
	 * @return - TransferTransaction entity with generated transaction id (for insert).
	 */
	public TransferTransaction saveTransferTransaction(TransferTransaction transaction);
	/**
	 * Deletes an expense transaction.
	 * @param transactionId - Id of expense transaction to be deleted.
	 */
	public void deleteExpenseTransaction(Long transactionId);
	/**
	 * Deletes an income transaction.
	 * @param transactionId - Id of income transaction to be deleted.
	 */
	public void deleteIncomeTransaction(Long transactionId);
	/**
	 * Deletes a transfer transaction.
	 * @param transactionId - Id of transfer transaction to be deleted.
	 */
	public void deleteTransferTransaction(Long transactionId);
	/**
	 * Finds expense transactions matching search criteria
	 * @param criteria - TransactionSearchCriteria. Populate at least year of monthwise calendar
	 * @return - List<ExpenseTransaction> - List of matching expense transactions
	 */
	public List<ExpenseTransaction> getExpenseTransactions(TransactionSearchCriteria criteria);
	/**
	 * Finds income transactions matching search criteria
	 * @param criteria - TransactionSearchCriteria. Populate at least year of monthwise calendar
	 * @return - List<ExpenseTransaction> - List of matching income transactions
	 */
	public List<IncomeTransaction> getIncomeTransactions(TransactionSearchCriteria criteria);
	/**
	 * Finds transfer transactions matching search criteria
	 * @param criteria - TransactionSearchCriteria. Populate at least year of monthwise calendar
	 * @return - List<ExpenseTransaction> - List of matching transfer transactions
	 */
	public List<TransferTransaction> getTransferTransactions(TransactionSearchCriteria criteria);
}
